/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.me.countrycity.tests;

import android.app.Activity;
import junit.framework.Assert;
import org.me.countrycity.SQL.WordsInit;
import org.me.countrycity.SQL.WordsSQL;
import org.me.countrycity.utill.eCategories;
/**
 *
 * @author kipi
 */
public class SQLTest {

    private static final String TAG = "MyActivity";
    WordsSQL words;

    public SQLTest(Activity activity) {
        WordsInit initer = new WordsInit(activity);
        initer.InitWords();

        words = initer.getWordsSQL();

        Assert.assertTrue(words.IsWordInCategory("אלבניה", eCategories.Contry));
        Assert.assertFalse(words.IsWordInCategory("אלבניה", eCategories.City));
        Assert.assertFalse(words.IsWordInCategory("אלגו", eCategories.City));
        Assert.assertTrue(words.IsWordInCategory("בת ים", eCategories.City));
        Assert.assertTrue(words.IsWordInCategory("בת ים", eCategories.Alive));
        Assert.assertFalse(words.IsWordInCategory("בת ים", eCategories.Contry));
        Assert.assertEquals(5, words.WordsByLetter('א').length);
        Assert.assertEquals(6, words.WordsByLetter('ב').length);
        Assert.assertEquals(2, words.WordsByLetterAndCategory('א', eCategories.Contry).length);
        Assert.assertEquals(3, words.WordsByLetterAndCategory('ב', eCategories.Contry).length);
    }
}
